FROM mcr.microsoft.com/playwright:v1.40.0-jammy

# 设置工作目录
WORKDIR /app

# 复制package文件
COPY package*.json ./

# 安装依赖
RUN npm ci

# 复制源代码
COPY . .

# 创建报告目录
RUN mkdir -p reports/screenshots

# 用户配置
USER root
RUN chown -R pwuser:pwuser /app
USER pwuser

# 启动命令
CMD ["npm", "run", "test"]